#!/bin/bash

while :;
do
	mv log/stdout.log "log/`date +%d_%m_%Y_%H_%M`_stdout.log"
	# Remove old backups and logs
	find log -mtime +7|xargs rm -f
	
	java -server -Dfile.encoding=UTF-8 -Xmx512m -Xbootclasspath/p:../serverslibs_gameguard/l2ft.jar -cp config/xml:../serverslibs_gameguard/*: l2ft.loginserver.AuthServer > log/stdout.log 2>&1

	[ $? -ne 2 ] && break
	sleep 10;
done
